package com.recycle.system.domain.dto;


import com.recycle.common.enums.Recyclable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ReferPriceDTO {

    private String resourceTypeName;
    private BigDecimal  referencePrice;
    private String type;

    public ReferPriceDTO(String resourceTypeName, BigDecimal referencePrice){
        this.resourceTypeName = resourceTypeName;
        this.referencePrice = referencePrice;
    }

    public void typeTransformer(){
        if(resourceTypeName.equals(Recyclable.PAPER.getLabel())){
            this.type = "paper";
        }else
        if(resourceTypeName.equals(Recyclable.PLASTIC.getLabel())){
            this.type = "plastic";
        }else
        if(resourceTypeName.equals(Recyclable.GLASS.getLabel())){
            this.type = "glass";
        }else
        if(resourceTypeName.equals(Recyclable.METAL.getLabel())){
            this.type = "metal";
        }else
        if(resourceTypeName.equals(Recyclable.CLOTH.getLabel())){
            this.type = "fabric";
        }

    }
}
